package com.firmboy.axis2test.config;


import org.apache.axis2.transport.http.AxisServlet;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.servlet.ServletContext;
import java.io.BufferedInputStream;
import java.io.InputStream;

/**
 * @author firmboy
 * @create 2018-06-06 下午7:25
 **/
@Configuration
public class Axis2Config {

    @Bean
    public ServletRegistrationBean axisServlet(){

        //String repositoryPath = String.format("%sWEB-INF", getClass().getResource("/").getPath());
        ServletRegistrationBean servlet = new ServletRegistrationBean();
        servlet.setServlet(new AxisServlet());
        servlet.addUrlMappings("/services/*");
        servlet.setName("AxisServlet");
        servlet.setLoadOnStartup(1);
        //servlet.addInitParameter(PARAM_AXIS2_REPOSITORY_PATH, repositoryPath);
        return servlet;
    }


}
